import { getMedicineOrderDetailApi } from '@/services/order'
import {
  // computed,
  // reactive,
  // watch,
  // onBeforeMount,
  onMounted,
  // onBeforeUpdate,
  // onUpdated,
  // onBeforeUnmount,
  // onUnmounted,
  ref
} from 'vue'
import type { MedicineOrderDetail } from '@/types/order'

export function orderDetail(id: string) {
  const medicineOrderDetail = ref<MedicineOrderDetail>()

  const loading = ref(false)

  const getMedicineOrderDetail = async () => {
    const { data } = await getMedicineOrderDetailApi(id)
    medicineOrderDetail.value = data
  }

  onMounted(() => {
    getMedicineOrderDetail()
  })

  return {
    medicineOrderDetail,
    loading
  }
}
